\documentclass{ctexart}
\bibliographystyle{IEEEtran}
\usepackage{algorithm,algorithmic,amsmath,amsthm,amssymb,amsfonts}
\usepackage{listings,graphics}

\title{1.8.2 Programming assignments Report}
\author{张祺 3210104145}

\begin{document}
\maketitle

\subsection*{B}
\begin{itemize}
\item[(1)] $x^{-1}-tan(x)$ on $\left[0,\frac{\pi}{2}\right]$.\par
  $root = 0.860333$, $f(root) = 1.16367e-06$.
\item[(2)] $x^{-1}-2^x$ on $\left[0,1\right]$.\par
  $root = 0.641186$, $f(root) = -5.61904e-08$.
\item[(3)] $2^{-x}+e^x+2cos(x)-6$ on $\left[1,3\right]$.\par
  $root = 1.82938$, $f(root) = -2.89365e-06$.
\item[(4)] $\frac{x^3+4x^2+3x+5}{2x^3-9x^2+18x-2}$ on $\left[0,4\right]$.\par
  $root = 0.117877$, $f(root) = 770900$. Because of the discontinuity of the function, this root is wrong.
\end{itemize}

\subsection*{C}
$x=tan(x)$
\begin{itemize}
\item[(1)] $x_0=4.5, root=4.49341, f(root) = -5.10541e-08$
\item[(2)] $x_0=7.7, root=7.72525, f(root) = -6.17859e-08$
\end{itemize}

\subsection*{D}
\begin{itemize}
\item[(1)] $sin(x/2)-1$\par
  with $x_0=0,x_1=\frac{\pi}{2}$, $root = 3.14157$, $f(root) = -6.46735e-11$.\\
  with $x_0=-\frac{\pi}{2},x_1=0$, $root = 3.14157$, $f(root) = -8.11659e-11$.\\
  with $x_0=10,x_1=12$, $root = 15.708$, $f(root) = -6.40467e-11$.
\item[(2)] $e^{x}-tan(x)$\par
  with $x_0=1,x_1=1.4$, $root = 1.30633$, $f(root) = -6.52234e-12$.\\
  with $x_0=-4,x_1=-3$, $root =-3.09641$, $f(root) = -3.5847e-13$.\\
  with $x_0=9,x_1=10$, $root = -3.09641$, $f(root) = -4.65739e-14$.
\item[(3)] $x^3-12x^2+3x+1$\par
  with $x_0=0,x_1=-0.5$, $root = -0.188685$, $f(root) = 2.08722e-14$.\\
  with $x_0=1,x_1=2$, $root = 0.451543$, $f(root) = -8.43769e-14$.\\
  with $x_0=9,x_1=10$, $root = 11.7371$, $f(root) = 1.63425e-13$.
\end{itemize}
Secant method can only find one zero at a time, and for equations with multiple zeros, different initial values will give different roots.

\subsection*{E}
Three methods get the same result $h:0.166166$.

\subsection*{F}
\begin{itemize}
\item[(1)] $\alpha = 32.9722$
\item[(2)] $\alpha = 33.1689$
\item[(3)] $\alpha = 168.5$, the original equation has infinite solutions in the real nuber field.
\end{itemize}
\end{document}
